/*
 * Copyright (c)  小马哥. 2022-2024. All rights reserved.
 *
 */

package com.phsms.common.sensitive.controller;

import com.phsms.common.sensitive.annotation.Desensitization;
import com.phsms.common.sensitive.entity.SensitiveEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * 敏感控制器
 * @author Mar
 * @date 2023年1月16日11:14:45
 */
@RestController
@RequestMapping("sensitive")
public class SensitiveController {

    @GetMapping("list")
    @Desensitization
    public List<SensitiveEntity> listData() {
        List<SensitiveEntity> sensitiveEntities = new ArrayList<>();
        for(int i=1;i<10;i++){
            SensitiveEntity dto = new SensitiveEntity();
            dto.setName("张三"+i);
            dto.setMobile("1389087658"+i);
            dto.setIdCard("62020119980908027"+i);
            sensitiveEntities.add(dto);
        }
        return sensitiveEntities;
    }
}
